 {% load myfilter  %}
 {% load md2 %}


{%for post in posts%} 
<article id="post-{{post.id}}" class="post-{{post.id}} post type-post status-publish format-standard hentry category-uncategorized">       
    <header class="entry-header">
        {%if post.post_type == 'post'%}
            <h1 class="entry-title">
                <a title="{{post.post_title}}" href="/blog/article/{{post.id}}" rel="bookmark">{{post.post_title}}</a>
            </h1>
        {%endif%}
        <div class="comments-link">
          
            {%if post.comment_count > 0%}
                {%if post.post_type == 'post'%}
                    <a href="/blog/?p={{post.id}}#nav-single" title="评论 {{post.post_titile}}">
                {%else%}
                    <a href="/blog/page/{{post.id}}#nav-single" title="评论 {{post.post_titile}}">
                {%endif%}
                    <i class="fa fa-comments "></i><span class="leave-reply">{{post.comment_count}}条回复</span>
            {%else%}
                {%if post.post_type == 'post'%}
                    <a href="/blog/?p={{post.id}}#respond" title="评论 {{post.post_titile}}">
                {%else%}
                    <a href="/blog/page/{{post.id}}#respond" title="评论 {{post.post_titile}}">
                {%endif%}
                    <i class="fa fa-comment-o  "></i><span class="leave-reply">发表回复</span>
            {%endif%}
            </a>
        </div>
    </header>

    <div class="entry-content">
        <p>
        {% if post.post_mime_type == "markdown" %}
         {{post.post_content|markdown:"codehilite,nl2br,fenced_code"}}
        {%elif post.post_mime_type == "text/html" %} 
            {{post.post_content|safe }}
        {%else%}
 
              {{post.post_content|autocode}}
         {%endif%}
    </p>

    </div>

    <footer class="entry-meta">
    发布在 
    {%if post.cat %}
    <a href="/blog/cat/{{post.cat.term_id}}" rel="category">{{post.cat.name}}</a> 
    {%else%}
        未分类
    {%endif%}
    {%if post.post_type == 'post'%}
     <a href="/blog/?p={{post.id}}" title="{{post.post_date}}" rel="bookmark">
     {%else%}
     <a href="/blog/page/{{post.id}}" title="{{post.post_date}}" rel="bookmark">
     {%endif%}
            <i class="fa fa-clock-o"></i>
            <time class="entry-date" datetime="{{post.post_date}}">{{post.post_date|date:"Y M d D H:i:s"}}</time></a>
            <span class="by-author"> by 
                <span class="author vcard">
                    <a class="url fn n" href="/blog/author/1" title="View all posts by {{post.post_author}}" rel="author">{{post.post_author}}</a>
                </span>
            </span>     
            {%if more%}
            <i class="fa fa-eye"></i>
            <span class="read-more">
                {{post.views}}次
            </span>
            <span class="read-more">
                <a class="read-more" href="/blog/article/{{post.id}}"> 阅读更多...</a>
            </span> 
            {%endif%}                   
    </footer>

</article><!-- #post -->
{%endfor%}

{{info}}